<?php
$servername = "localhost";
$username = "";
$password = "";
$dbname = "";

$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
    die("Connection failed: ". $conn->connect_error);
}
$conn->set_charset("utf8");

$sql = "DELETE FROM show_event WHERE DATEDIFF(NOW(), endtime) >= 3";
if ($conn->query($sql) === TRUE) {
    echo "删除成功";
} else {
    echo "Error: ". $sql. "<br>". $conn->error;
}
$conn->close();
?>